package exceptionDemo2;

public class User {
	private int id;
	private String email;
	private String pwd;
	
	public User(){}
	public User(int id, String email, String pwd) {
		super();
		this.id = id;
		this.email = email;
		this.pwd = pwd;
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getPwd() {
		return pwd;
	}
	public void setPwd(String pwd) {
		this.pwd = pwd;
	}
	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return id;
	}
	@Override
	public boolean equals(Object obj) {
		// TODO Auto-generated method stub
		if(null==obj) return false;
		if(this==obj) return true;
		if(obj instanceof User){
			User user = (User)obj;
			return this.id==user.getId() && this.email.equals(user.getEmail()) && this.pwd.equals(user.getPwd());
		}
		return false;
	}
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return "当前用户ID= "+id+",email="+email+",pwd="+pwd;
	}
	
}
